package cn.iocoder.yudao.module.trade.enums.giftcard;

import cn.hutool.core.util.ObjectUtil;
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.Arrays;

@RequiredArgsConstructor
@Getter
public enum GiftCardGroupTypeEnum implements IntArrayValuable{

    GOODS(0, "商品"),
    STORED_CARD(1, "储值卡"),;

    public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(GiftCardGroupTypeEnum::getType).toArray();

    /**
     * 类型
     */
    private final Integer type;
    /**
     * 类型名
     */
    private final String name;

    @Override
    public int[] array() {
        return ARRAYS;
    }

    public static boolean isGoods(Integer type) {
        return ObjectUtil.equal(type, GOODS.getType());
    }

    public static boolean isStoredCard(Integer type) {
        return ObjectUtil.equal(type, STORED_CARD.getType());
    }




}
